package com.hikviison.rpq.quartz.quartz.task;

import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.Date;

/**
 * @author renpeiqian
 * @date 2021/9/14 10:58
 * @since
 */
@Slf4j
public class TaskB implements Job {

    private static final ThreadLocal<Integer> threadLocalA = new ThreadLocal<>();

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        int num = threadLocalA.get() == null ? 0 : threadLocalA.get();
        //log.info("taskB方法执行次数：{}", ++num);
        threadLocalA.set(num);

    }
}
